package route

import (
	"github.com/gin-gonic/gin"
	"github.com/vueadmin/app/admin/internal/handler/membe"
	"github.com/vueadmin/app/admin/internal/middle"
	"github.com/vueadmin/app/admin/internal/svc"
	"github.com/vueadmin/middleware"
	"github.com/vueadmin/utils/conv"
)

type Membe struct{}

/**
 * @description(会员管理路由)
 * @buildcode(true)
*/
func (Membe) RegisterRoute(route *gin.Engine, svcCtx *svc.ServiceContext) {
	r := route.Group(svcCtx.Config.Prefix)
	r.Use(middleware.JwtVerifyMiddleware(conv.String(svcCtx.Config.Jwt)), middle.NewBeforActionMiddleware(svcCtx).Handle())

	r.POST("/Membe/index", func(c *gin.Context) {membe.GetPageList(c, svcCtx)})               //数据列表
	r.POST("/Membe/updateExt", func(c *gin.Context) {membe.UpdateExt(c, svcCtx)})               //修改排序开关
	r.POST("/Membe/add", func(c *gin.Context) {membe.Add(c, svcCtx)})               //添加
	r.POST("/Membe/update", func(c *gin.Context) {membe.Update(c, svcCtx)})               //修改
	r.POST("/Membe/getUpdateInfo", func(c *gin.Context) {membe.GetUpdateInfo(c, svcCtx)})               //修改
	r.POST("/Membe/delete", func(c *gin.Context) {membe.Delete(c, svcCtx)})               //删除
	r.POST("/Membe/detail", func(c *gin.Context) {membe.Detail(c, svcCtx)})               //查看详情
	r.POST("/Membe/resetPwd", func(c *gin.Context) {membe.ResetPwd(c, svcCtx)})               //重置密码
	r.POST("/Membe/import", func(c *gin.Context) {membe.Import(c, svcCtx)})               //导入
	r.POST("/Membe/export", func(c *gin.Context) {membe.Export(c, svcCtx)})               //客户端导出
	r.POST("/Membe/jia", func(c *gin.Context) {membe.Jia(c, svcCtx)})               //充值
	r.POST("/Membe/jian", func(c *gin.Context) {membe.Jian(c, svcCtx)})               //扣除
	r.POST("/Membe/forbidden", func(c *gin.Context) {membe.Forbidden(c, svcCtx)})               //状态禁用
}

